/*
    This source file is part of GeNa project.
    Copyright © GeNa project 2008
    For the latest info, see http://code.google.com/p/genaproject/ or  http://lumpyproject.forums-rpg.com

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Foobar is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Foobar.  If not, see <http://www.gnu.org/licenses/>. */

#ifndef BRUSH_H_INCLUDED
#define BRUSH_H_INCLUDED

#include <vector>
#ifndef WX_PCH_H_INCLUDED
#include "wx_pch.h"
#endif

//Boost serialization
#include <boost/archive/basic_archive.hpp>
#include <boost/serialization/base_object.hpp>
#include <boost/serialization/version.hpp>

#include "math/vector.h"

using namespace boost::serialization;

class Edge;
class Face;
class Brush;
class Vertex;
class Map;

class Edge
{
public:
    Vertex *vertex1, *vertex2;
    Face *face1, *face2;

    template<class Archive> void serialize(Archive & ar, const unsigned int version);
};

BOOST_CLASS_VERSION(Edge, 0)

class Face
{
public:
    std::vector<Edge*> edge_loop;
    std::vector<Vertex*> vertices;

    template<class Archive> void serialize(Archive & ar, const unsigned int version);
};

BOOST_CLASS_VERSION(Face, 0)

class Vertex
{
public:
    math::vector3q vertex;
    std::vector<Face*> faces;
    std::vector<Edge*> edges;

    template<class Archive> void serialize(Archive & ar, const unsigned int version);
};

BOOST_CLASS_VERSION(Vertex, 0)

class Brush
{
public:
    std::vector<Vertex*> vertices;
    std::vector<Edge*> edges;
    std::vector<Face*> faces;

    class Map* map;

    template<class Archive> void serialize(Archive & ar, const unsigned int version);
};

BOOST_CLASS_VERSION(Brush, 0)

class Group
{
public:
    std::vector<Brush*> brushes;

    template<class Archive> void serialize(Archive & ar, const unsigned int version);
};

BOOST_CLASS_VERSION(Group, 0)


#endif // BRUSH_H_INCLUDED
